package de.codecasa.andro.kasse;


import android.os.Bundle;

import android.app.TabActivity;
import android.view.Menu;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;


import android.widget.TabHost.TabSpec;

import android.widget.TabHost;




public class MainActivity extends TabActivity { 
	
	public DatabaseManager db;	
	public SQLiteDatabase connection;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        db = new DatabaseManager(this);
        connection = db.getWritableDatabase();
        
        
        setContentView(R.layout.activity_main);

        TabHost tabHost = getTabHost();
        
     // Tab for Gastraum
        TabSpec kasseSpec = tabHost.newTabSpec("Kasse");
        TabSpec productsSpec = tabHost.newTabSpec("Artikel");
        TabSpec setupSpec = tabHost.newTabSpec("Einstellungen");

        // setting Title and Icon for the Tab
        kasseSpec.setIndicator("Kasse");
        productsSpec.setIndicator("Artikel");
        setupSpec.setIndicator("Einstellungen");

        Intent groomIntent = new Intent(this, AC_kasse.class);
        Intent productsIntent = new Intent(this, AC_Products.class);
        Intent setupIntent = new Intent(this, AC_Setup.class);

        kasseSpec.setContent(groomIntent);
        productsSpec.setContent(productsIntent);
        setupSpec.setContent(setupIntent);
        
        // Adding all TabSpec to TabHost
        tabHost.addTab(kasseSpec); // Adding photos tab        
        tabHost.addTab(productsSpec); // Adding photos tab     
        tabHost.addTab(setupSpec); // Adding photos tab     
        
 
  
    }

 
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
   
}
